import React  from "react"
import { BrowserRouter as Router, Route, Switch } from "react-router-dom"
import { routeConfig } from "./route-config"

export class Routes extends React.Component<{}, {}> {
  render() {
    return (
      <Router>
        <Switch>
          { routeConfig.map( ( val) => {
            return <Route
              exact={val.exact}
              key={val.name}
              path={val.path}
              component={val.component}
            />
          })}
        </Switch>
      </Router>
    )
  }
}

export default Routes
